/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models;


import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import tableModels.TableReservationModel;
import utils.TableModel;

/**
 *
 * @author Cholet Julien et Florence Delbarre
 */
public class Reservation  {
    protected int _numcommande;
    protected String _datecommande;
    protected int _ID_client;
    protected int _identifiant;
    protected int _nbrplace;
    private ReservationMapper mapper;
    
    public Reservation() {
        this.mapper = new ReservationMapper();
    }

    public int getNumcommande() {
        return _numcommande;
    }

    public void setNumcommande (int _numcommande) {
        this._numcommande = _numcommande;
    }
    
    public String getDatecommande() {
      return _datecommande;
    }
    
    public void setDatecommande(String _datecommande){
        this._datecommande = _datecommande;
    }
           
  
    public int getId_client() {
        return _ID_client;
    }

    public void setId_client (int _id_client) {
        this._ID_client = _id_client;
    }
    public int getIdentifiant() {
        return _identifiant;
    }

    public void setIdentifiant (int _identifiant) {
        this._identifiant = _identifiant;
    }
    public int getNbrplace() {
        return _nbrplace;
    }

    public void setNbrplace (int _nbrplace) {
        this._nbrplace = _nbrplace;
    }

    public TableReservationModel fetchAll() {
        return mapper.fetchAll();
    }
    
     public void save() {
        mapper.save(this);
    }
     
     public void find(int id) {
        try {
            this.mapper.find(id, this);
        } catch (SQLException ex) {
            Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
